package com.example8.web_flux_module.config;

import com.example8.web_flux_module.controller.FunctionInterfaceController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

/**
 * @Description 路由配置
 * @Author lihw
 * @Date 2024/1/9 16:08
 */
@Configuration(proxyBeanMethods = false)
@Slf4j
public class RouteConfig {

    @Autowired
    FunctionInterfaceController functionInterfaceController;


    @Bean
    public RouterFunction<ServerResponse> helloRoute() {
        return RouterFunctions.route()
                .GET("/user/fn", request -> ServerResponse.ok().body(Mono.just("pq"), String.class))
                .build();
    }
}
